package com.lichuang.dedao.city.controller;


import com.lichuang.dedao.city.entity.Comment;
import com.lichuang.dedao.city.service.impl.CommentServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author wp
 * @since 2019-07-13
 */
@RestController
@RequestMapping("//comment")
@CrossOrigin("http://localhost:8020")
public class CommentController {

    @Autowired
    CommentServiceImpl commentService;


    /**
     * 查询所有评论
     * @return
     */
    @RequestMapping("selAllComm")
    public List selAllComm(){
        return commentService.contextLoads();
    }


    /**
     * 插入评论
     * @param comment
     * @return
     */
    @RequestMapping("/insNoteComment")
    public int insNoteComment(Comment comment){
        return commentService.insNoteComment(comment);
    }



}
